//导入Vue
import Vue from 'vue'

//导入路由
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import moment from 'moment'

//定义全局的过滤器
Vue.filter('dateFormat',function (dataStr, pattern='YYYY-MM-DD HH:mm:ss') {
    return moment(dataStr).format(pattern)
})


//导入Vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)
// 设置请求的根路径
Vue.http.options.root = 'http://vue.studyit.io'
Vue.http.options.emulateJSON = true

//按需导入mint-ui组件
// import { Header, Swipe, SwipeItem, Button,Lazyload} from 'mint-ui';
// Vue.component(Header.name,Header)
// Vue.component(Swipe.name, Swipe);
// Vue.component(SwipeItem.name, SwipeItem);
// Vue.component(Button.name,Button);
// Vue.use(Lazyload);
import MintUI from 'mint-ui'
Vue.use(MintUI)
import 'mint-ui/lib/style.css'


//引入veu-preview
import VuePreview from 'vue-preview'
//使用vue-preview
Vue.use(VuePreview)

// with parameters install
// Vue.use(preview, {
//     mainClass: 'pswp--minimal--dark',
//     barsSize: {top: 0, bottom: 0},
//     captionEl: false,
//     fullscreenEl: false,
//     shareEl: false,
//     bgOpacity: 0.85,
//     tapToClose: true,
//     tapToToggleControls: false
// })


//导入mui
import './lib/mui/css/mui.css'
import './lib/mui/css/icons-extra.css'

import './css/app.less'

//导入路由模块
import router from './router'

//导入app组件
import app from './App.vue'

let vm = new Vue({
    el: '#app',
    render: c => c(app),
    router
})